//
//  UIImage+Category.h
//  DCProject
//
//  Created by bigbing on 2019/4/1.
//  Copyright © 2019 bigbing. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIImage (Category)

#pragma mark - 生成特定颜色得图片
+ (UIImage *)dc_initImageWithColor:(UIColor *)color size:(CGSize)size;

#pragma mark - 等比压缩图片
+ (UIImage *)dc_scaleToSize:(UIImage *)img size:(CGSize)size;

#pragma mark - 获取启动图图片
+ (UIImage *)dc_getLaunchImage;

#pragma mark - 图片旋转
+ (UIImage *)dc_image:(UIImage *)image rotation:(UIImageOrientation)orientation;

#pragma mark - 图片缩小
+ (UIImage *)dc_scaleImage:(UIImage *)image toScale:(float)scaleSize;

#pragma mark - layer 创建图片
+ (UIImage *)dc_imageFromLayer:(CALayer *)layer;


#pragma mark - 默认底图
+ (UIImage *)dc_placeholderImage;

@end


typedef void (^GIFimageBlock)(UIImage *GIFImage);

#pragma mark - gif图
@interface UIImage (GIFImage)

/** 根据本地GIF图片名 获得GIF image对象 */
+ (UIImage *)imageWithGIFNamed:(NSString *)name;

/** 根据一个GIF图片的data数据 获得GIF image对象 */
+ (UIImage *)imageWithGIFData:(NSData *)data;

/** 根据一个GIF图片的URL 获得GIF image对象 */
+ (void)imageWithGIFUrl:(NSString *)url and:(GIFimageBlock)gifImageBlock;



@end

NS_ASSUME_NONNULL_END
